package com.ddn.controller.hall;

import com.ddn.service.hall.DiningService;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/*
  ❀❀❀---扎根---❀❀❀
    ❤ @libing ❤
  
*/
@RestController
@RequestMapping("/dining")
public class DiningController {

    @Autowired
    private DiningService diningService;

    /**
     * 查找全部的会议厅信息
     * @param map
     * @return
     */
    @RequestMapping("/list")
    public ResultData diningList(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = diningService.findAllDining(map);
        return resultData;
    }

    /**
     * 删除会议厅信息
     * @param map
     * @return
     */
    @RequestMapping("/delete")
    public ResultData diningDelete(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = diningService.deleteDining(map);
        return resultData;
    }

    /**
     * 增加报告厅信息
     * @param map
     * @return
     */
    @RequestMapping("/add")
    public ResultData addDining(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = diningService.addDining(map);
        return resultData;
    }

    /**
     * 增加报告厅信息
     * @param map
     * @return
     */
    @RequestMapping("/update")
    public ResultData updateDining(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = diningService.updateDining(map);
        return resultData;
    }

    /**
     * 批量删除报告厅信息
     * @param ids
     * @return
     */
    @RequestMapping("/batch")
    public ResultData batchDining(@RequestParam List<Integer> ids) {
        System.out.println(ids);
        ResultData resultData = diningService.batchDining(ids);
        return resultData;
    }
}
